package com.gaofans.vertx.boot.dbutils.config;

import com.gaofans.vertx.boot.dbutils.session.impl.SessionFactory;
import io.vertx.sqlclient.Pool;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(PostgresqlAutoConfig.class)
@ConditionalOnBean(Pool.class)
public class SessionFactoryAutoConfig {

    @Bean
    public SessionFactory sessionFactory(Pool pool){
        return new SessionFactory(pool);
    }
}
